package cn.test.app.a.fallback;

import cn.ifloat.brick.sprofile.common.ConditionServerMode;
import cn.test.app.a.api.OrderApi;
import cn.test.app.a.domain.Ord;
import cn.test.app.a.vo.OrdVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.List;

@Lazy
@Service
@ConditionServerMode
public class OrderFallBack implements OrderApi {
    Logger logger = LoggerFactory.getLogger(this.getClass());

    @PostConstruct
    public void init(){
        System.err.println("订单服务降级初始化");
    }

    @Override
    public void add(Ord ord) {
        logger.error("访问order  add    服务降级");
    }

    @Override
    public Boolean del(Long id) {
        logger.error("访问order  del    服务降级");
        return null;
    }

    @Override
    public Boolean edit(Ord ord) {
        logger.error("访问order  edit    服务降级");
        return null;
    }

    @Override
    public List<Ord> list(OrdVo ordVo) {
        logger.error("访问order  条件查询list    服务降级");
        return null;
    }

    @Override
    public List<Ord> ordList() {
        logger.error("访问order  list    服务降级");
        return null;
    }
}
